#ifndef __PAY_TFT_H__
#define __PAY_TFT_H__

#include "PayBox.h"


// brightness: 0-255
void payTFTInit(TFT_eSPI &tft, uint32_t brightness) {
  tft.init();
  tft.setRotation(7);
  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_WHITE, TFT_BLACK);
  tft.setTextFont(2);
  tft.setCursor(0, 0);
  // 设置背光
  ledcSetup(0, 2000, 8);
  ledcAttachPin(PAY_TFT_BAK, 0);
  ledcWrite(0, (255 - brightness));
}

#endif